<template>
	<view class="address">
		<view class="container">
			<view class="col">
				<view class="title">默认地址</view>
				<dzList mr :list="list"></dzList>
			</view>
			<view class="col">
				<view class="title">选择其他地址</view>
				<dzList :list="list"></dzList>
			</view>
		</view>
		<footer-btn text="添加收货地址" @submit="toNav(`address/editAddress`)"></footer-btn>
	</view>
</template>

<script>
import API from '@/common/api';
export default {
	name: 'addressIndex',
	data() {
		return {
			list:[]
		};
	},
	onLoad() {
		
	},
	onShow() {
		this.init();
	},
	methods: {
		init() {
			API.getJson('userAddress_lists', {}).then((res) => {
				const { code, data, message } = res;
				if (code === 1) {
					this.list = data;
				}
			});
		}
	}
};
</script>

<style lang="less" scoped>
.address {
	.container {
		padding: 0rpx 32rpx 26rpx;
		.col {
			.title {
				padding: 26rpx 0 20rpx;
				font-size: 24rpx;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				color: #666666;
			}
		}
	}
}
</style>
